<template>
  <div class="wrapper">
    <div class="title">热销推荐</div>
    <ul class="list">
        <router-link class="item border-bottom" v-for="item of list" :key="item.id" tag="li" :to="'/detail/'  + item.id">
          <img :src="item.imgUrl" class="img">
          <div class="item-info">
            <p class="item-title">{{item.title}}</p>
            <p class="item-desc">{{item.desc}}</p>
            <button class="item-button">查看详情</button>
          </div>
        </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'recommend',
  props: {
    list: Array
  }
}
</script>

<style lang="stylus" scoped>
  @import "~styles/mixins.styl"
  .wrapper
    overflow hidden
    .title
      margin-top: 0.2rem
      line-height: 0.4rem
      text-indent: 0.2rem
      background #eee
    .item
      display flex
      overflow hidden
      height: 2rem
    .img
      display: block
      height: 1.7rem
      padding: .1rem
      width: 1.7rem
    .item-info
      flex: 1
      min-width 0
      padding: 0.1rem
      .item-title
        font-size 0.32rem
        line-height: 0.54rem
        ellipsis()
      .item-desc
        line-height: 0.4rem
        font-size 0.28rem
        color: #ccc
        ellipsis()
    .item-button
      background #ff9300
      line-height: 0.44rem
      padding: 0 0.2rem
      color: #fff
      margin-top: 0.2rem
      border-radius: 0.06rem
</style>
